package com.sec.springcloud.Feign;

import com.sec.springcloud.pojo.scinfo;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class HystrxbackFactory implements FallbackFactory<FergnServiceClient> {
    public FergnServiceClient create(Throwable throwable) {
        return new FergnServiceClient() {
            public boolean add(String name) {
                return false;
            }

            public scinfo queryId(Long id) {
                return new scinfo().setName("没有对应的信息，Consumer客户端提供的降级信息，此刻服务Provider已经关闭");
            }

            public List query() {
                return null;
            }
        };
    }
}
